<!-- 订单导出 -->
<style>
    .order-export {
        position: fixed;
        width: 400px;
        height: 200px;
        top: 50%;
        left: 50%;
        background-color: #ffffff;
        margin: -200px 0 0 -200px;
        z-index: 19999;
    }

    .order-export form {
        padding: 20px 0 25px;
    }

    .order-export .line {
        padding-bottom: 5px;
        margin-bottom: 10px;
        border-bottom: 1px solid #e6e6e6;
    }
</style>
<div class="float-confirm order-export" style="display: none;">
    <div class="float-confirm-con">
        <h2 class="line" style="font-size:18px;color:#23a18b;">选择订单时间</h2>
        <form>
            订单时间:<input type="date" name="order_export_date_start"> - <input type="date" name="order_export_date_end">
            <div class="order-export-msg"></div>
        </form>
        <div class="line"></div>
        <div class="float-confirm-btns" style="padding-bottom:30px;">
            <a class="btn btn-default btn-sm right js-cancel" href="javascript:void(0);">取消</a>
            <a class="btn btn-success btn-sm right js-submit" href="javascript:void(0);">导出数据</a>
        </div>
    </div>
</div>
<script>
    (function ($) {
            var layer = $('.order-export');
            var order_date_start, order_date_end, url;

            $(document.body).on('click', '.export_excel', function (e) {
                e.preventDefault();
                layer.show();
                $.pageMask.show();
                url = $(this).data('url');
                return false;
            });

            layer.on('click', '.js-submit', function (e) {
                e.preventDefault();

                order_date_start = $('input[name="order_export_date_start"]').val();
                order_date_end = $('input[name="order_export_date_end"]').val();
                if (order_date_start && order_date_end) {
                    url = url + "&search_filter[start_date_add]="+order_date_start+"&search_filter[end_date_add]="+order_date_end;
                    window.location.href = url //download
                } else {
                    $('.order-export-msg').html('<br><font color="red">请选择订单起止时间 !</font>');
                }

                return false;
            });

            layer.on('click', '.js-cancel', function (e) {
                e.preventDefault();
                layer.hide();
                $.pageMask.hide();
                return false;
            });
    })(jQuery);
</script>
<!-- /订单导出 -->
